package com.ruoyi.controller;


import com.ruoyi.dto.dahua.DaHuaIncomeDetailsDto;
import com.ruoyi.dto.dahua.DaHuaPageQueryDto;
import com.ruoyi.service.IDaHuaDigitalService;
import com.ruoyi.vo.dahua.DaHuaResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 大华数字孪生大屏请求
 */
@CrossOrigin
@RestController
@RequestMapping("/digital")
public class DaHuaDigitalController {

    @Autowired
    private IDaHuaDigitalService daHuaDigitalService;

    /**
     * 停车场列表
     * @param daHuaPageQueryDto
     */
    @GetMapping("/getParkingList")
    public DaHuaResponse getParkingList(DaHuaPageQueryDto daHuaPageQueryDto) {
        return daHuaDigitalService.getParkingList(daHuaPageQueryDto);
    }

    /**
     * 停车场收入明细
     * @param daHuaIncomeDetailsDto
     */
    @PostMapping("/getIncomeDetails")
    public DaHuaResponse getIncomeDetails(@RequestBody DaHuaIncomeDetailsDto daHuaIncomeDetailsDto) {
        return daHuaDigitalService.getIncomeDetails(daHuaIncomeDetailsDto);
    }

    /**
     * 收入概况同比
     * @param parkingId
     */
    @GetMapping("/getIncomeOverview")
    public DaHuaResponse getIncomeOverview(Long parkingId) {
        return daHuaDigitalService.getIncomeOverview(parkingId);
    }

    /**
     * 停车位统计
     * @param parkingId
     */
    @GetMapping("/getParkingLot")
    public DaHuaResponse getParkingLot(Long parkingId) {
        return daHuaDigitalService.getParkingLot(parkingId);
    }

}
